/*
 * @Author: levi7754 levi7754@163.com
 * @Date: 2025-02-26 10:05:28
 * @LastEditors: levi7754 levi7754@163.com
 * @LastEditTime: 2025-10-12 18:24:21
 * @FilePath: \wms-app\api\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { ajax } from '../http';

/* 登录 */
export const login = (data) => {
	return ajax.get('/oauth-service/oauth/token', data)
}

/* 获取系统语言 */
export const getLanuage = (data) => {
	console.log(data)
	return ajax.get('/nature-permission/api/nt/dict/get_language_by_tenant', data)
}

/* 系统初始化 */
export const init = (data) => {
	return ajax.get('/nature-core/api/nt/account/info', data)
}
export const getUserAuth = (data) => {
	return ajax.get('/nature-permission/api/nt/permission/select_user_permission_data', data)
}

/* 获取数据字典 */
export const initDict = (data) => {
	return ajax.post('/nature-permission/api/nt/dict/page_dict_info', data)
}

/* 获取库存组织 */
export const getInvOrgList = (query) => {
	return ajax.get('/nature-wms/api/v1/organization/selectBySorg', query)
}

/* 获取库存选项 */
export const getInvOpts = (query) => {
	return ajax.get('/nature-wms/api/v1/inv-module-config', query)
}

/* 获取货位信息 */
export const getCargospace = barCode => {
	return ajax.get('/nature-wms/api/v1/store-cargo-space/scan', { barCode })
}

/* 获取工单信息 */
export const getJobOrder = barCode => {
	return ajax.get('/nature-wms/api/v1/manufactureOrder/barCode', { barCode })
}
/* 获取工单现有量信息 */
export const getMoOnhandList = barCode => {
	return ajax.get('/nature-wms/api/v1/getMoOnhandList/sub', { barCode })
}

/* 获取工单现有量信息 */
export const getOnhandQty = param => {
	return ajax.get('/nature-wms/api/v1/subsistence', param)
}
